<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>订单列表</title>
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <meta name="format-detection" content="telephone=no">

    <link rel="stylesheet" href="../../css/aui.css">
    <link rel="stylesheet" href="../../css/common.css">
    <script type="text/javascript" src="../../script/api.js"></script>
    <script language="JavaScript" src="../../script/vue.js"></script>
    <script language="JavaScript" src="../../script/common.js"></script>
    <link rel="stylesheet" href="../../css/orderitem.css">
    <style>
        .aui-tab-item.aui-active {
            color: #e02e24;
            border-bottom: 2px solid #e02e24;
        }
    </style>
</head>

<body>
    <div class="aui-content" id="order-box">
        <header class="aui-bar aui-bar-nav" id="header">
            <a class="aui-pull-left aui-btn" onclick="closewin();">
                <span class="aui-iconfont aui-icon-left"></span>
            </a>
            <div class="aui-title">订单列表</div>
        </header>

        <div class="aui-tab">
            <div class="aui-tab-item" :class="{'aui-active':status=='all'}" @click="orderlist($event,'all')">全部</div>
            <div class="aui-tab-item" :class="{'aui-active':status=='wait_pay'}" @click="orderlist($event,'wait_pay')">待付款</div>
            <div class="aui-tab-item" :class="{'aui-active':status=='wait_pin'}" @click="orderlist($event,'wait_pin')">待拼单</div>
            <div class="aui-tab-item" :class="{'aui-active':status=='wait_send'}" @click="orderlist($event,'wait_send')">待发货</div>
            <div class="aui-tab-item" :class="{'aui-active':status=='wait_recv'}" @click="orderlist($event,'wait_recv')">待收货</div>
        </div>

    </div>



    <script>
        var vm = new Vue({
            el: "#order-box",
            data: {
                token: '',
                status: '',

            },
            methods: {

                orderlist: function(e, flag) {
                    this.status = flag;
                  //  $page.switchnav(e, 'aui-active');
                     vm.openorder();

                },
                openorder:function(){
                  var headerh = $api.dom('#order-box').offsetHeight;
                  $page.openfrm('home_orderlist_frame'+status, './orderlist_frame.html', {
                      x: 0,
                      y: headerh,
                      h: api.winHeight - headerh
                  }, {
                      status: this.status
                  }, false,true);
                }


            }
        });
        apiready = function() {
       
            vm.token = $api.getStorage('token');
            $page.init();
            var pageParam = api.pageParam;
            vm.status = pageParam.status;
            vm.openorder();

        }
    </script>
</body>

</html>
